﻿Imports System
Imports System.Web
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports DotNetNuke
Imports DotNetNuke.UI.UserControls
Imports DotNetNuke.UI

Namespace NVPortal.Modules.NVProduct

    Public MustInherit Class SanphamCungLoai
        Inherits Entities.Modules.PortalModuleBase
#Region "Controls"
#End Region

#Region "Event Handlers"

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Try
                If Not IsPostBack Then

                    Dim arrNews As New ArrayList
                    Dim ctlNews As New ProductController
                    arrNews = ctlNews.Product_GetSameCatParent(4, Request.Item("catsanpham"), PortalId)

                    Dim ctlProductCat As New NV_ProductCategoriesController
                    Me.lblTenDanhmuc.Text = ctlProductCat.GetByID(Request.Item("catsanpham")).CategoryName
                    Me.rptSanpham.DataSource = arrNews
                    Me.rptSanpham.DataBind()
                End If
            Catch ex As Exception
                'Me.imgNews.Visible = False
                ' Exception
                ProcessModuleLoadException(Me, ex)
            End Try
        End Sub
        Public Function ReplaceChuoi(ByVal chuoi As String) As String
            Dim convert As String = Global.ReplaceChuoi.bodau(chuoi).Replace(" ", "-")
            Return convert
        End Function
        Public Function FormatURL(ByVal sitem As String, ByVal strLink As String) As String
            Dim tabshow As Integer
            tabshow = Settings("ProductDisplayPageSetting")
            Return "/527/" & sitem & "/" & ReplaceChuoi(strLink) & ".aspx"
        End Function
#End Region
        'phan trang
        Private Sub InitializeComponent()
        End Sub
        Protected Overrides Sub OnInit(ByVal e As EventArgs)
            InitializeComponent()
            MyBase.OnInit(e)
        End Sub
        'Het phan trang
    End Class

End Namespace
